package com.zhaolaobao.redis.consumer;

import com.zhaolaobao.redis.mode.RedisTestUser;
import com.zhaolaobao.redis.queue.annotation.RedisDelayQueueHandler;
import com.zhaolaobao.redis.queue.annotation.RedisDelayQueueListener;

/**
 * @ClassName RedisDelayQueueConsumer
 * @Description //
 * @Author WHX
 * @Date 2021/10/29 14:18
 **/
@RedisDelayQueueHandler
public class RedisDelayQueueConsumer {
    public static final String REDIS_TEST_QUEUE = "redis_test_queue:";
    public static final String REDIS_TEST_OBJECT_QUEUE = "redis_test_object_queue:";


    @RedisDelayQueueListener(queueName = REDIS_TEST_QUEUE)
    public void testQueue(String json){
        System.out.println("消费成功: "+ json);
    }


    /**
     * 队列名重复测试
     * @param user
     */
/*    @RedisDelayQueueListener(queueName = REDIS_TEST_OBJECT_QUEUE)
    public void testObjQueue2(RedisTestUser user){
        System.out.println("消费成功: "+ user);
    }*/


    @RedisDelayQueueListener(queueName = REDIS_TEST_OBJECT_QUEUE)
    public void testObjQueue(RedisTestUser user){
        System.out.println("消费成功: "+ user);
    }
}
